<!DOCTYPE html>
<html >

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> SSE </title>
</head>

<style>
    * {
        padding: 0;
        margin: 0;
    }
    .box {
        display: flex;
        height: 50px;
    }
    .box1 {
        width: 200px;
        border: 1px solid #ccc;
        float: left;
    }
    .box2 {
        flex: 1;
        border: 1px solid #f0f;
        /* white-space: normal; */
        /* 要是 可以换行，box1 不会缩小，反之，box1 的宽度 是会缩小的 */
        white-space: nowrap;
    }

    /* 方式二：浮动 */
    .box_1 {
        height: 50px;
    }
    .left1 {
        width: 200px;
        border: 1px solid #ccc;
        height: 100%;
        float: left;
    }
    .right1 {
        border: 1px solid #f0f;
        margin-left: 200px;
        height: 100%;
    }

    /* 方式三：绝对定位 */
    .box_2 {
        height: 50px;
        position: relative;
    }
    .left2 {
        width: 200px;
        border: 1px solid #ccc;
        height: 100%;
        position: absolute;
    }
    .right2 {
        border: 1px solid #f0f;
        width: 100%;
        height: 100%;
        position: absolute;
        left: 200px;
    }
</style>

<body>
    方式一：flex 布局
    <div class="box" >
        <div class="box1" ></div>
        <div class="box2" >自适应</div>
    </div>

    方式二：浮动
    <div class="box_1" >
        <div class="left1" ></div>
        <div class="right1" >自适应</div>
    </div>

    <div style="overflow: hidden;" >--</div>

    方式三：绝对定位
    <div class="box_2" >
        <div class="left2" ></div>
        <div class="right2" >自适应</div>
    </div>



    <script>
        if ('EventSource' in window) {
            console.log("---", 'EventSource' in window)
        }
    </script>
</body>

</html>